<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>我的参团</title>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <!--weui.min.css-->
    <link rel="stylesheet" href="/static/index/css/page/base.css"/>
    <link rel="stylesheet" href="/static/index/css/page/font.css"/>
    <link rel="stylesheet" href="/static/index/jquery_weui/css/swiper.min.css"/>
    <link rel="stylesheet" type="text/css" href="/static/index/jquery_weui/lib/weui.min.css">
    <!--jquery-weui.min.css-->
    <link rel="stylesheet" type="text/css" href="/static/index/jquery_weui/css/jquery-weui.min.css">
    <link rel="stylesheet" href="/static/index/css/page/personal.css" />
</head>
<body>
<div class="pageControl bg-fff">
    <!--主体-->
    <div class="main">
        <div class="msui_nav msui_navTop">
            <a class="msui_navTop-back" href="javascript:history.back();"><i class="micon-back"></i></a>
            <h1 class="msui_navTop-title">充值</h1>
        </div>
        <div class="weui-cell">
            <div class="weui-cell__bd recharge-top">
                <img src="/static/index/images/jb3.png" alt="">
                <span class="coins">{$info.coins}</span>
            </div>
            <div class="weui-cell__ft">
                <a href="javascript:;" class="cl-f recharge-top_btn">充值</a>
            </div>
        </div>
        <div class="weui-cell recharge_noBorder">
            <div class="weui-cell__bd ">
                拾友币充值 <input class="recharge_input weui-input" type="text" readonly>需 <span class="recharge_price"> </span>元
            </div>
        </div>
        <div style="height: .5rem;background: #f5f5f5"></div>
        <div class="recharge_flex">
            <a href="" class="cl-3333">
                <div class="recharge_flex1">
                    <span>60</span>
                    <img src="/static/index/images/jb1.png" alt="">
                </div>
                <div class="recharge_flex2">
                    <img src="/static/index/images/jb4.png" alt="">
                </div>
                <div class="recharge_flex3">
                    ￥ <span>6</span>
                </div>
            </a>
            <a href="" class="cl-3333">
                <div class="recharge_flex1">
                    <span>180</span>
                    <img src="/static/index/images/jb1.png" alt="">
                </div>
                <div class="recharge_flex2">
                    <img src="/static/index/images/jb5.png" alt="">
                </div>
                <div class="recharge_flex3">
                    ￥ <span>18</span>
                </div>
            </a>
            <a href="" class="cl-3333">
                <div class="recharge_flex1">
                    <span>300</span>
                    <img src="/static/index/images/jb1.png" alt="">
                </div>
                <div class="recharge_flex2">
                    <img src="/static/index/images/jb7.png" alt="">
                </div>
                <div class="recharge_flex3">
                    ￥ <span>30</span>
                </div>
            </a>
            <a href="" class="cl-3333">
                <div class="recharge_flex1">
                    <span>980</span>
                    <img src="/static/index/images/jb1.png" alt="">
                </div>
                <div class="recharge_flex2">
                    <img src="/static/index/images/jb8.png" alt="">
                </div>
                <div class="recharge_flex3">
                    ￥ <span>98</span>
                </div>
            </a>
            <a href="" class="cl-3333">
                <div class="recharge_flex1">
                    <span>1980</span>
                    <img src="/static/index/images/jb1.png" alt="">
                </div>
                <div class="recharge_flex2">
                    <img src="/static/index/images/jb9.png" alt="">
                </div>
                <div class="recharge_flex3">
                    ￥ <span>198</span>
                </div>
            </a>
            <a href="" class="cl-3333">
                <div class="recharge_flex1">
                    <span>3000</span>
                    <img src="/static/index/images/jb1.png" alt="">
                </div>
                <div class="recharge_flex2">
                    <img src="/static/index/images/jb6.png" alt="">
                </div>
                <div class="recharge_flex3">
                    ￥ <span>300</span>
                </div>
            </a>
        </div>
    </div>
</div>
<!-- jquery-2.1.4 -->
<script type="text/javascript" src="/static/index/jquery_weui/lib/jquery-2.1.4.js"></script>
<!-- jquery-weui.min.js -->
<script type="text/javascript" src="/static/index/jquery_weui/js/jquery-weui.min.js"></script>
<script src="/static/index/jquery_weui/js/swiper.min.js"></script>
<script>
    $('.recharge_flex').on('click','a',function (e) {
        e.preventDefault();
        var that=$(this);
        var t=that.find('.recharge_flex1 span').html();
        var price=that.find('.recharge_flex3 span').html();
        that.addClass('active').siblings().removeClass('active');
        $('.recharge_input').val(t);
        $('.recharge_price').html(price);
    })
    $('.recharge-top_btn').on('click',function(){
        price = $('.recharge_price').html();
        $.post(
            "/index/personal/recharge",
            {price: price},
            function(data){
                if(data.code == 1){
                    alert(data.msg);
                    window.history.go(-1);
                }else{
                    if (confirm("余额不足咯，是否现在去充值？")) {
                        window.location.href="/index/personal/wallet?id="+data.user_id;
                    }
                }
            }
        ),'json'
    })
</script>
</body>
</html>

